package com.atguigu.bean;

import org.springframework.beans.factory.FactoryBean;

//创建spring定义的工厂bean
public class ColorFactoryBean implements FactoryBean<Color> {
    //容器中加入的是Color类型
    @Override
    public Color getObject() throws Exception {
        System.out.println("Color factory bean getObject");
        return new Color();
    }

    @Override
    public Class<?> getObjectType() {
        return Color.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}
